<template>
	<view class="flex" @click="ischeck = !ischeck" :style="[style]">
		<m-icon :type="ischeck?'icon-xuanzhong_-01':'icon-weixuanzhong_-01-01'" wh="34" spa="0 10 0 0"
			color="var(--theme)"></m-icon>
		<m-text color="#999999">我已阅读并同意</m-text>
		<m-text color="var(--theme)" @click="Jump('/pagesA/news/detail/detail?code='+code)">《{{title}}》</m-text>
		<template v-if="code2">
			<m-text>和</m-text>
			<m-text color="var(--theme)" @click="Jump('/pagesA/news/detail/detail?code='+code2)">《{{title2}}》</m-text>
		</template>
	</view>
</template>

<script>
	import mixin from "../../libs/mixin/mixin.js"
	export default {
		mixins: [mixin],
		name: "m-agreement",
		data() {
			return {
				ischeck: false,
			};
		},
		props: {
			title: {
				type: String,
				default: ''
			},
			code: {
				type: String,
				default: ''
			},
			code2: {
				type: String,
				default: ''
			},
			title2: {
				type: String,
				default: ''
			},
			value: true,
		},
		mounted() {
			this.ischeck = this.value
		},
		watch: {
			ischeck(val) {
				this.$emit("input", val)
			}
		},
	}
</script>

<style lang="scss">

</style>